package com.jsu.clubmanagementsystem.model.enums;

/**
 * 活动状态枚举值
 */
public enum ActivityStatusEnum {
    WAITING_REVIEW(0, "待审核"),
    READY(1, "确认举办"),
    START(2, "进行中"),
    END(3, "已结束"),
    CANCEL(4, "无效");

    /**
     * 状态码
     */
    private int code;

    /**
     * 详情
     */
    private String info;

    ActivityStatusEnum(int code, String info) {
        this.code = code;
        this.info = info;
    }

    public static ActivityStatusEnum getStatusEnumByCode(int code){
        for (ActivityStatusEnum statusEnum : values()) {
            if (statusEnum.getCode() == code){
                return statusEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }
}
